let MarryState = function () {
    let _currentState = {},
        states = {
            jump() {
                console.log('jump');
            },
            move() {
                console.log('move');
            },
            shoot() {
                console.log('shoot');
            },
            squat() {
                console.log('squat');
            }
        };
    let Action = {
        changeState() {
            let arg = arguments;
            _currentState = {};
            if (arg.length) {
                for(let i = 0; i < arg.length; i++) {
                    _currentState[arg[i]] = true;
                }
            }
            return this;
        },
        goes() {
            console.log('触发一次动作');
            for (let i in _currentState) {
                states[i] && states[i]();
            }
            return this;
        }
    };
    return {
        change: Action.changeState,
        goes: Action.goes
    }
};

let marry = new MarryState();
marry.change('jump', 'shoot').goes().goes().change('shoot').goes();